# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: team/phosh <newbyte@postmarketos.org>
pkgname=feedbackd
pkgver=0.3.0
pkgrel=0
pkgdesc="Daemon to provide haptic, LED, and audio feedback triggered by application events"
url="https://source.puri.sm/Librem5/feedbackd"
arch="all"
license="GPL-3.0-or-later"
depends="dbus feedbackd-device-themes"
makedepends="
	gi-docgen
	glib-dev
	gmobile-dev
	gobject-introspection-dev
	gsound-dev
	gtk-doc
	json-glib-dev
	libgudev-dev
	meson
	vala
	"
subpackages="$pkgname-dev $pkgname-doc"
source="https://sources.phosh.mobi/releases/feedbackd/feedbackd-$pkgver.tar.xz"
install="$pkgname.pre-install $pkgname.pre-upgrade"

build() {
	abuild-meson \
		-Db_lto=true \
		-Dgtk_doc=true \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
	install -Dm644 "$builddir"/debian/feedbackd.udev \
		"$pkgdir"/usr/lib/udev/rules.d/90-feedbackd.rules
}

sha512sums="
243ee56cb96541181fc2ae614ae80be694dc1d7cf3a240927f843efb7c8736e0c4ca227af8872ed3caad68ff896c5339ea3f4148099f5327a16ca0c95346d996  feedbackd-0.3.0.tar.xz
"
